package com.pic.mgt.haishin.manager.business;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.pic.mgt.HaishinLauncher;
import com.pic.mgt.manager.business.BusinessManagementOperationException;
import com.pic.mgt.manager.business.BusinessManager;

public class HaishinBusinessListSyncExecutionQuartzJob extends QuartzJobBean {

	@Override
	protected void executeInternal(JobExecutionContext arg0)
			throws JobExecutionException {
		BusinessManager businessManager = HaishinLauncher.applicationContext.getBean(
														"simpleHaishinBusinessManager",
														BusinessManager.class);
		try {
			businessManager.synchronizeBusiness();
		} catch (BusinessManagementOperationException e) {
			e.printStackTrace();
			// 不用寫 Log
		}
	}

}
